package com.zhuss.controller.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.core.append.CreateUserAppendBo;
import com.zhuss.bean.bo.core.append.DeleteUserAppendBo;
import com.zhuss.bean.bo.core.append.UpdateUserAppendBo;
import com.zhuss.bean.bo.core.append.wechat.FocusUserBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.core.append.UserAppendOperateServiceExt;
import com.zhuss.exception.WpsException;


/**
 * @description: 用户关注、点赞操作的Controller
 * @author: zhushanshuo
 * @create: Fri Jul 03 20:49:22 CST 2020
 **/
@RestController
@RequestMapping("/userAppend")
public class UserAppendOperateController extends BaseController {
	
	@Autowired
	@Qualifier("userAppendOperateService")
	private OperateService<Void, Object> userAppendOperateService;
	
	@Autowired
	@Qualifier("userAppendOperateServiceExt")
	private UserAppendOperateServiceExt userAppendOperateServiceExt;
	
	/**
	 * 创建
	 * @param bo
	 * @throws WpsException
	 */
	@ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateUserAppendBo bo) throws WpsException {
		
		userAppendOperateService.create(bo);
    }
	
	
	/**
	 * 修改
	 * @param bo
	 * @throws WpsException
	 */
	@ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateUserAppendBo bo) throws WpsException {
		
		userAppendOperateService.update(bo);
    }
	
	/**
	 * 删除
	 * @param bo
	 * @throws WpsException
	 */
	@ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteUserAppendBo bo) throws WpsException {
		
		userAppendOperateService.delete(bo);
    }
	
	/**
	 * 关注
	 * @param bo
	 * @throws WpsException
	 */
	@ResponseBody
	@PostMapping("/focus")
	public void focus(@RequestBody FocusUserBo bo) throws WpsException {
		
		userAppendOperateServiceExt.focus(bo);
	}
	
	/**
	 * 取消
	 * 关注
	 * @param bo
	 * @throws WpsException
	 */
	@ResponseBody
    @PostMapping("/delFocus")
    public void delFocus(@RequestBody FocusUserBo bo) throws WpsException {
		
		userAppendOperateServiceExt.delFocus(bo);
    }
	
}
